<?php
/**
 * Default Widget Manager Template
 *
 * @package OWL
 * @subpackage Default Template
 * @author KeiMOon
 * @since 1.0
 */
class Template_Widgets_Manager extends Owl_Master_Template {
    protected function init() {
        $user = Owl_User::get_instance();
        if (!$user->is_logged_in()) {
            Owl_Functions::go_to_template("login");
        }
        assign("title", get_option("site_name") . " - " . __("Widgets manager"));
        assign("page-title", __("Widgets manager"));
        enqueue_style('default-setting');
        enqueue_style('default-icon');       
        register_sidebar(array(
	'name' =>'Widget không hiển thị',
	'id' => 'owl_inactive_widgets',
        'before_sidebar' => '<div id="owl-inactive-widget-body">',
        'after_sidebar' => '<div style="clear:both"></div></div>',
	'before_widget' => '',
	'after_widget' => '',
	'before_title' => '',
	'after_title' => '',
        'before_content'=>'',
        'after_content'=>''
        ));
        retrieve_widgets();        
    }
    protected function main_content() {
?>
<div id="setting-navigation">
    <?php Owl_Default_Content::setting_navigation(); ?>
    <div style="clear:both;"></div>
</div>
<div id="setting-page-header" class="has-icon icon-widget-manager-48">
    <div id="setting-page-title">
        <?php put("page-title"); ?>
    </div>
</div>
<div id="setting-main-content">
    <!-- Content here -->    
    <div id="available-widgets" class="widgets-holder-wrap">
        <h3><?php echo __('Avaiable widget'); ?> <span id="removing-widget" style="color:red;"><?php echo __('Delete'); ?> <span></span></span></h3>
        <div class="widget-holder">
            <p class="description"><?php echo __('Drag widget form here into sidebar in order to active widget, drag widget from sidebar into here in order to delete widget.'); ?></p>
            <?php
            global $owl_widget_control;
            $owl_widget_control->get_list_widget();
            ?>
        </div>
        <div style="clear:both;"></div>
    </div>
    <div class="widgets-holder-wrap">
       <h3><?php echo __('Inactive widgets'); ?>
       <span><img src="images/ajax_dark.gif" class="ajax-feedback" title="" alt="" style="vertical-align:middle;visibility:hidden;"/></span></h3>
        <div class="widget-holder inactive">
                <p class="description"><?php echo __('Drag widget into here to delete it but retain its configuration.'); ?></p>
                <?php get_dynamic_sidebar('owl_inactive_widgets'); ?>                
                <div style="clear:both;"></div>
        </div>
    </div>

</div>
<?php    
    }
}